
/** 
 * 在页面调用  this.$api[key].method
*/

let  path  =  [      // 文件路径
    './example',
    './nearby/index',
], obj = {}

let pathToHumpVar=(path)=>{
    var newPath = path.replace('./',"");
    newPath = newPath.replace(/\/(\w)/g, function(all, letter){
         return letter.toUpperCase();
    }); 
    return  newPath
}
path.forEach((item,index)=>{
    let key =  pathToHumpVar(item)
    let value =  require(item + '.js')
    obj[key] =  value
})
console.log(obj,'api')

module.exports = {
    ...obj
}